****** Calendar ******
*** 31082023 ***
REPORT Calendar.

*DATA: DATE TYPE SY-DATUM.

*** TYPE 1 带周六周日显示 ***
PARAMETERS: P_DATE TYPE D.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_DATE.
CALL FUNCTION 'ISU_EDM_DATE_CONTROL_POPUP'
EXPORTING
X_DATE = SY-DATUM
IMPORTING
Y_DATE_SELECTED = P_DATE.

*** TYPE 2 不带周六周日显示 ***
PARAMETERS: P_DATE TYPE D.
AT SELECTION-SCREEN ON VALUE -REQUEST FOR P_DATE.
CALL FUNCTION 'F4_DATE'
IMPORTING
SELECT_DATE = P_DATE.

*** TYPE 3 年月下拉框选择 ***
PARAMETERS: P_DATE TYPE ISELLIST-MONTH.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_DATE.
CALL FUNCTION 'POPUP_TO_SELECT_MONTH'
EXPORTING
ACTUAL_MONTH = SY-DATUM+0(6)
IMPORTING
SELECTED_MONTH = P_DATE.

*** TYPE 4 不带周六周日显示 ***
PARAMETERS: P_DATE TYPE D.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_DATE.
CALL FUNCTION 'F4_DATE_CONTROL'
EXPORTING
DATE_FOR_FIRST_MONTH = SY-DATUM
IMPORTING
SELECT_DATE = P_DATE
EXCEPTIONS
Calendar_BUFFER_NOT_LOADABLE = 1
DATE_AFTER_RANGE = 2
DATE_BEFORE_RANGE = 3
DATE_INVALID = 4
FACTORY_CALENDAR_NOT_FOUND = 5
HOLIDAY_CALENDAR_NOT_FOUND = 6
PARAMETER_CONFLICT = 7
OTHERS = 8.